<template>
	<el-drawer title="招聘需求详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
						</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="招聘计划" prop="planId">{{form.planTitle}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-form-item label="需求标题" prop="title">{{form.title}}
				</el-form-item>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="招聘部门" prop="deptName">{{form.deptName}}
						</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="招聘人数" prop="userCount">{{form.userCount}}人
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="人员特长" prop="skills">{{form.skills}}
						</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="所学专业" prop="major">{{form.major}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="招聘工种" prop="workJob">{{form.workJobName}}
						</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="要求学历" prop="education">{{form.educationName}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="要求性别" prop="sex">
							<el-tag type="success" size="small" v-if="form.sex==='1'">男</el-tag>
							<el-tag type="danger" size="small" v-else-if="form.sex==2">女</el-tag>
							<el-tag type="danger" size="small" v-else>不限</el-tag>
						</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="出生日期" prop="birthDay">{{form.birthDay}}
						</el-form-item>
					</el-col>
				</el-row>
				<el-row :gutter="24">
					<el-col :lg="12">
						<el-form-item label="招聘类型" prop="occupation">{{form.occupationName}}
						</el-form-item>
					</el-col>
					<el-col :lg="12">
						<el-form-item label="到岗日期" prop="lastTime">{{form.lastTime}}
						</el-form-item>
					</el-col>
				</el-row>
					<el-form-item label="招聘备注">{{form.remark}}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId: '',
				sortNo: '',
				planTitle:'',
				title: '',
				deptName: '',
				userCount: 0,
				skills: '',
				major: "",
				workJobName: '',
				educationName: '',
				sex: '0',
				birthDay: '',
				occupationName: '',
				lastTime: '',
				attachId: '',
				remark: ''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId = data.recordId
			this.form.sortNo = data.sortNo
			this.form.planTitle = data.planTitle
			this.form.title = data.title
			this.form.deptName = data.deptName
			this.form.userCount = data.userCount
			this.form.skills = data.skills
			this.form.major = data.major
			this.form.workJobName = data.workJobName
			this.form.educationName = data.educationName
			this.form.sex = data.sex
			this.form.birthDay = data.birthDay
			this.form.occupationName = data.occupationName
			this.form.lastTime = data.lastTime
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
